<template>
  <div class="unit7-boxs">
    <div class="boxs-left">
      <titles :title="props.info.text" style="margin-bottom: 100px" />
      <textMax :data="props.info.remarks" :maxLen="100" />
    </div>
    <div class="boxs-right">
      <div
        @click="pathChild(item)"
        :class="{
          'box-img-item1': index == 0,
          'box-img-item2': index == 1,
          'box-img-item3': index == 2,
          'box-img-item4': index == 3,
          'box-img-item5': index == 4,
          'box-img-item6': index == 5,
        }"
        class="right-item"
        v-for="(item, index) in props.info.children"
        :key="item.id"
      >
        <div class="item-shadow">
          <span
            :style="{
              fontSize: store.styleInfo.mintitleSize,
              fontFamily: store.styleInfo.textFamily,
              color: '#fff',
            }"
            >{{ item.text }}</span
          >
        </div>
        <img
          class="box-img"
          :src="
            item.value
              ? urls + item.value + '?imageView2/1/w/200/h/200/format/webp'
              : 'http://101.34.143.36:8890/api/image/387939155165253/h_380,w_380'
          "
          alt=""
        />
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { pathList, pathListLoop } from '../route';
import { urls } from '@/utils/request/upload';
import titles from '@/components/title/title.vue';
import buttonIcon from '@/components/title/buttonIcon.vue';
import textMax from '@/components/textMax/textMax.vue';
import { onMounted } from 'vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';

const router = useRouter();
const route = useRoute();
const props = defineProps({
  info: {
    type: Object,
  },
});
const store = useProjectStore();
const pathChild = (e: any) => {
  store.setchildModel(e);
  router.push({
    path: route.meta.loopType ? pathListLoop[8] : pathList[8],
    query: { projectId: localStorage.getItem('projectId') },
  });
};
</script>

<style lang="less" scoped>
@import './index.less';
.unit7-boxs {
  display: flex;
  width: 100%;
}
.boxs-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}
.boxs-right {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 620px;
  height: 620px;
  border: 1px dashed #cfbda8;
  border-radius: 50%;
  margin: 80px;
}
.right-item {
  position: relative;
  cursor: pointer;
  width: 200px;
  height: 200px;
  border-radius: 50%;
}
.box-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
}
.box-img-item1 {
  margin-left: -50px;
  margin-top: 50px;
}
.box-img-item2 {
  margin-top: -100px;
}
.box-img-item3 {
  margin-top: 50px;
  margin-right: -50px;
}
.box-img-item4 {
  margin-left: -50px;
  margin-top: 100px;
}
.box-img-item5 {
  margin-top: 300px;
}
.box-img-item6 {
  margin-top: 100px;
  margin-right: -50px;
}
.item-shadow {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.4);
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.right-item:hover {
  .item-shadow {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
  }
}
</style>
